﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script src="../scripts/boot.js" type="text/javascript"></script>
    <script type="text/javascript">
        $.ajax({
            url: "../data/system.aspx?method=76",
            async: false,
            success: function (text) {
                if (text == "no")
                    window.location = "../system/error.html";
                else if (text == "out") {
                    var loginWindow = parent.mini.get("loginWindow");
                    if (!loginWindow.visible)
                        loginWindow.show();
                    var tabs = parent.mini.get("mainTabs");
                    var tab = tabs.getTab("tab$76");
                    tabs.removeTab(tab);
                }
            }
        });
        var Type = [{ id: 41, text: '通知公告' }, { id: 42, text: '情况通报' }, { id: 43, text: '时政快递' }, { id: 44, text: '网上党校' }, { id: 45, text: '学习园地' }, { id: 46, text: '党员风采' }, { id: 47, text: '支部活动' }, { id: 48, text: '办事指南'}];
    </script>
</head>
<body>
    <div class="mini-fit">
        <div id="divList" class="mini-fit">
            <div class="mini-toolbar" style="border-bottom: 0;">
                <table >
                    <tr>
                        <td>
                            <a class="mini-button" iconcls="icon-search" plain="true" onclick="search();">查询</a>
                            <span class="separator"></span>
                            <a class="mini-button" iconcls="icon-ok" plain="true" onclick="create()">生成</a>
                            <span class="separator"></span>
                            <a target="_blank" class="mini-button" iconcls="icon-home" plain="true" href="../../Web/Party/Index.html">浏览</a>
                        </td>
                    </tr>
                </table>
            </div>
            <div class="mini-fit">
                <div id="datagrid1" class="mini-datagrid" style="width: 350px; height: 100%;" allowresize="true"
                    url="../data/system.aspx?method=GetPartyNewsList" idfield="id" multiselect="true" sizeList="[15,20,50,100]" pageSize="15">
                    <div property="columns">
                        <div field="nw_type" width="120px" align="center" headeralign="center" renderer="onTypeRenderer">栏目</div>
                        <div field="nw_count" width="70px" align="center" headeralign="center">资讯数</div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
    <script type="text/javascript">
        $.ajaxSetup({
            contentType: "application/x-www-form-urlencoded;charset=utf-8",
            complete: function (XMLHttpRequest, textStatus) {
                if (XMLHttpRequest.responseText == "out") {
                    var loginWindow = parent.mini.get("loginWindow");
                    if (!loginWindow.visible)
                        loginWindow.show();
                }
            }
        });

        mini.parse();
        var grid = mini.get("datagrid1");
        search();

        //查询
        function search() {
            grid.load();
        }

        //生成
        function create() {
            mini.confirm("确定生成静态页面？", "系统提示",
                function (action) {
                    if (action == "ok") {
                        mini.mask({ el: document.body, cls: 'mini-mask-loading', html: '操作中，请稍后...' });

                        $.ajax({
                            url: "../data/system.aspx?method=CreatePartyHtml",
                            type: "post",
                            success: function (ret) {
                                mini.unmask(document.body);
                                if (ret == "out") {
                                    var loginWindow = parent.mini.get("loginWindow");
                                    if (!loginWindow.visible)
                                        loginWindow.show();
                                    return;
                                }
                                if (ret == 1) {
                                    ShowMessage("系统提示", "静态页面生成成功！", 1);
                                }
                                else
                                    ShowMessage("系统提示", "静态页面生成失败！", 3);
                            },
                            error: function (XMLHttpRequest, textStatus, errorThrown) {
                                mini.unmask(document.body);
                                ShowMessage("系统提示", "静态页面生成失败！", 3);
                            }
                        });
                    }
                }
            );
        }
    </script>
</html>
